/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author HoangHai
 */
@Entity
@Table(name = "ReEvaluation")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ReEvaluation.findAll", query = "SELECT r FROM ReEvaluation r"),
    @NamedQuery(name = "ReEvaluation.findByReID", query = "SELECT r FROM ReEvaluation r WHERE r.reID = :reID"),
    @NamedQuery(name = "ReEvaluation.findByReName", query = "SELECT r FROM ReEvaluation r WHERE r.reName = :reName"),
    @NamedQuery(name = "ReEvaluation.findByReDesc", query = "SELECT r FROM ReEvaluation r WHERE r.reDesc = :reDesc"),
    @NamedQuery(name = "ReEvaluation.findByStatus", query = "SELECT r FROM ReEvaluation r WHERE r.status = :status")})
public class ReEvaluation implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    @Basic(optional = false)
    //@NotNull
    @Column(name = "ReID")
    private Integer reID;
    @Size(max = 50)
    @Column(name = "ReName")
    private String reName;
    @Size(max = 1073741823)
    @Column(name = "ReDesc")
    private String reDesc;
    @Column(name = "Status")
    private Integer status;
    @JoinColumn(name = "SubID", referencedColumnName = "SubID")
    @ManyToOne
    private Subject subID;
    @JoinColumn(name = "StuID", referencedColumnName = "StuID")
    @ManyToOne
    private Student stuID;

    public ReEvaluation() {
    }

    public ReEvaluation(Integer reID) {
        this.reID = reID;
    }

    public Integer getReID() {
        return reID;
    }

    public void setReID(Integer reID) {
        this.reID = reID;
    }

    public String getReName() {
        return reName;
    }

    public void setReName(String reName) {
        this.reName = reName;
    }

    public String getReDesc() {
        return reDesc;
    }

    public void setReDesc(String reDesc) {
        this.reDesc = reDesc;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Subject getSubID() {
        return subID;
    }

    public void setSubID(Subject subID) {
        this.subID = subID;
    }

    public Student getStuID() {
        return stuID;
    }

    public void setStuID(Student stuID) {
        this.stuID = stuID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (reID != null ? reID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ReEvaluation)) {
            return false;
        }
        ReEvaluation other = (ReEvaluation) object;
        if ((this.reID == null && other.reID != null) || (this.reID != null && !this.reID.equals(other.reID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.ReEvaluation[ reID=" + reID + " ]";
    }
    
}
